package pl.un4giv3n.mightvsmagic.action;

import javax.persistence.EntityManager;

import pl.un4giv3n.mightvsmagic.entity.User;

/**
 * @author andrzejewskia
 * shows introduction page
 */
public class IntroductionPageAction extends PersistenceAction{
	private static final long serialVersionUID = -7854355266423978522L;

	public String execute() {
		EntityManager entityManager = getEntityManager();
		User user = getSessionUser(entityManager);
		if (user == null) {
			addActionError("Zaloguj się");
			entityManager.close();
			return LOGIN;
		}
		entityManager.close();
		return SUCCESS;
	}
}
